<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->

    <!-- 

        button a 标签的按钮 需要加入 class="btn btn-default" 
            删除加入 btn-danger 确认加入 btn-success;  
            h2标题后面添加返回的按钮
        
        table 需要添加 class="table table-bordered" 所有的按钮使用 icon; 外部a标签需要添加title=""提示

     -->

    <div class="main-title">
        <h2>商品 图组列表 <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button></h2>
    </div>
    <div></div>
    <br/>
    <div class="cf">
        <div class="fl">
            <a title="新增" class="btn btn-primary" href="{:U('add?goods_id='.$goods_id)}"><i class="glyphicon glyphicon-plus"></i></a>
            <button class="btn btn-danger ajax-post confirm" url="{:U('del')}" target-form="ids">删 除</button>
        </div>

        <!-- 高级搜索 -->
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
    <table class="table table-bordered">
    <thead>
        <tr>
        <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
        <th class="">ID</th>
        <th class="">缩略图</th>
        <th class="">排序</th>
        <th width="300" class="">操作</th>
        </tr>
    </thead>
    <tbody>
        <notempty name="_list">
        <volist name="_list" id="vo">
        <tr>
            <td width="1%"><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
            <td width="3%">
                {$vo.id}
            </td>
            <td width="12%"><div class="upload-img-box">
                <notempty name="vo.image">
                    <div class="upload-pre-item"><img src="{:url_format($vo['image'])}"/></div>
                </notempty>
                </div></td>
             
            <td width="12%">
                {$vo.sort}
            </td>
            
            <td width="24%">
                <a class="btn btn-default btn-xs" title="编辑" href="{:U('edit?id='.$vo['id'])}"><i class="glyphicon glyphicon-pencil"></i></a>
                <a href="{:U('del?id='.$vo['id'])}" class="confirm ajax-get btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
            </td>
        </tr>
        </volist>
        <else/>
        <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
        </notempty>
    </tbody>
    </table>
    </div>
    <div class="page">
        {$_page}
    </div>
    <div id="video-pre">
        <video controls="controls" autoplay="autoplay"></video>
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
    //搜索功能
    $("#search").click(function(){
        var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');

        var game  = $('.search-form').find('select').serialize();
        game = game.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        game = game.replace(/^&/g,'');

        if( url.indexOf('?')>0 ){
            url += '&' + query + '&' + game;
        }else{
            url += '?' + query + '&' + game;
        }
        window.location.href = url;
    });
    //回车搜索
    $(".search-input").keyup(function(e){
        if(e.keyCode === 13){
            $("#search").click();
            return false;
        }
    });
    //导航高亮
    highlight_subnav('{:U('index')}');
    </script>
</block>
